package com.waves.biz;

import org.springframework.stereotype.Repository;

import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;

/**
 * @Description: 缓存
 **/
@Repository
public class CacheRepository {
    private final ConcurrentMap<String, Object> cache = new ConcurrentHashMap<>();


    public void saveCache(String key, Object obj) {
        cache.put(key, obj);
    }

    public Object getCache(String key) {
        return cache.get(key);
    }

    public void removeCache(String key) {
        cache.remove(key);
    }
}
